package acom.dhy.qigsaw2test.qigsaw;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.ResourcesLoader;

import androidx.annotation.NonNull;

import com.google.auto.service.AutoService;
import com.iqiyi.android.qigsaw.core.splitload.compat.SplitResourcesLoader;

import java.util.Collections;

@AutoService(SplitResourcesLoader.class)
public class SplitResourcesLoaderCompat implements SplitResourcesLoader {
    public static int count = 0;

    @Override
    public void loadResources(@NonNull Context context, @NonNull Resources resources) {
        count++;
        ResourcesLoader.instance.loadResources(resources.getAssets());
    }

    @Override
    public void loadResources(@NonNull Context context, @NonNull Resources preResources, @NonNull String splitApkPath) {
        ResourcesLoader.instance.initFastCompare(preResources.getAssets(), Collections.singleton(splitApkPath));
    }
}
